<?php

namespace app\api\controller;

use think\App;
use think\facade\Config;
use think\facade\Event;
use app\common\model\User;
use app\common\library\Email;
use app\common\controller\Api;
use app\common\library\Ems as Emslib;
use think\Request;


/**
 * 邮箱验证码接口.
 */
class Match extends Api
{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';

    protected $model = null;

    /**
     * 构造方法
     * @access public
     * @param Request $request Request 对象
     */
    public function __construct(Request $request = null)
    {
        parent::__construct(App::getInstance());
        $this->model = new \app\api\model\Match();
    }

    public function _initialize()
    {
        parent::_initialize();
        if (!Config::get('fastadmin.usercenter')) {
            $this->error(__('User center already closed'));
        }
    }


    public function getList(){
        $user = $this->auth->getUserinfo();
        $requestData = $this->requestData;
        $data  = $this->model->getList($user,$requestData);
        $this->getReturnData($data);
    }


    public function getDetail(){
        $user = $this->auth->getUserinfo();
        $requestData = $this->requestData;
        $data  = $this->model->getDetail($user,$requestData);
        $this->getReturnData($data);
    }


    public function matchPay(){
        $requestData = $this->requestData;
        $user = $this->auth->getUserinfo();
        $data  = $this->model->matchPay($requestData, $user);
        $this->getReturnData($data);
    }


    public function getMatchOrderDetail(){
        $requestData = $this->requestData;
        $user = $this->auth->getUserinfo();
        $data  = $this->model->getMatchOrderDetail($requestData,$user);
        $this->getReturnData($data);


    }
}
